// ShapeDlg.cpp : implementation file
//

#include "stdafx.h"
#include "Raster.h"
#include "ShapeDlg.h"


// CShapeDlg dialog

IMPLEMENT_DYNAMIC(CShapeDlg, CDialog)

CShapeDlg::CShapeDlg(CWnd* pParent /*=NULL*/)
	: CDialog(CShapeDlg::IDD, pParent)
{

}

CShapeDlg::~CShapeDlg()
{
}

void CShapeDlg::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
}


BEGIN_MESSAGE_MAP(CShapeDlg, CDialog)
	ON_BN_CLICKED(IDOK, &CShapeDlg::OnBnClickedOk)
END_MESSAGE_MAP()

BOOL CShapeDlg::OnInitDialog()
{
	CDialog::OnInitDialog();

	m_pCheck1 = (CButton*)GetDlgItem(IDC_RADIO1);
	m_pCheck2 = (CButton*)GetDlgItem(IDC_RADIO2);
	m_pCombox = (CComboBox*)GetDlgItem(IDC_SHAPETYPE);
	m_pEdit = (CEdit*)GetDlgItem(IDC_EDIT1);

	CRect rtClient(0,0,0,0);
	m_pCombox->GetClientRect(rtClient);
	rtClient.bottom += 300;
	m_pCombox->SetWindowPos(NULL,0,0,rtClient.right,rtClient.bottom,SWP_NOMOVE | SWP_NOZORDER);
	m_pCheck1->SetCheck(1);
	m_pCheck2->SetCheck(0);

	for (int i=0;i<22;i++)
	{
		CString str;
		str.Format(_T("%d"),i);
		m_pCombox->InsertString(i,str);

	}
	m_pCombox->SetCurSel(0);
	return TRUE;
}

void CShapeDlg::EnableText()
{

}

void CShapeDlg::EnableShape()
{
	m_pCombox->EnableWindow(TRUE);
}

void CShapeDlg::DisableAll()
{
	
}


// CShapeDlg message handlers

void CShapeDlg::OnBnClickedOk()
{
	// TODO: Add your control notification handler code here
	m_pEdit->GetWindowText(m_str);
	m_nShape = m_pCombox->GetCurSel();
	m_bText = m_pCheck2->GetCheck();
	OnOK();
}
